소스 검색

update 更新在线文档

A17404李放 3 년 전
부모
커밋
a8be2248a7

+ 2 - 0
nb-admin/src/main/java/com/nb/admin/controller/IndexController.java

@@ -1,6 +1,7 @@
 package com.nb.admin.controller;
 
 import cn.hutool.extra.servlet.ServletUtil;
+import io.swagger.annotations.Api;
 import lombok.SneakyThrows;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -16,6 +17,7 @@ import javax.servlet.http.HttpServletResponse;
  * @author Kevin
  */
 @RestController
+@Api(hidden = true)
 public class IndexController {
 
     private static void writeIndex(HttpServletResponse response) {

+ 6 - 0
nb-admin/src/main/java/com/nb/admin/controller/common/CommonController.java

@@ -9,6 +9,9 @@ import com.nb.common.result.ResultCode;
 import com.nb.oss.strategy.FileStorageStrategy;
 import com.nb.oss.strategy.context.FileStorageContext;
 import com.nb.oss.strategy.storage.SysStorage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiOperation;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.MediaType;
@@ -33,6 +36,7 @@ import java.util.Objects;
 @RestController
 @RequestMapping("/common")
 @Slf4j
+@Api(tags = "通用控制器,用于文件的上传和下载",description = "关于病人的相关操作,查询操作权限【bus:patient:query】")
 public class CommonController {
 
     @Resource
@@ -70,6 +74,7 @@ public class CommonController {
 
     @PostMapping("/upload")
     @SneakyThrows
+    @ApiOperation("文件上传")
     public R<SysStorage> upload(@RequestParam("file") MultipartFile file) {
 //        if (StrUtil.isBlank(bizPath)) {
 //            throw new CustomException(ResultCode.PARAM_TYPE_ERROR.getMessage());
@@ -85,6 +90,7 @@ public class CommonController {
 
     @GetMapping("/download")
     @SneakyThrows
+    @ApiOperation("文件下载")
     public void download(@RequestParam String filepath, HttpServletResponse response) {
         response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
         // 文件名称转换,用户列表_uuid.xlsx -> 用户列表_1637469159968.xlsx

+ 2 - 0
nb-admin/src/main/java/com/nb/admin/controller/monitor/OnlineUserController.java

@@ -11,6 +11,7 @@ import com.nb.common.bo.LoginUser;
 import com.nb.common.redis.RedisUtils;
 import com.nb.common.result.R;
 import com.google.common.collect.Lists;
+import io.swagger.annotations.Api;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -27,6 +28,7 @@ import java.util.stream.Collectors;
  */
 @RestController
 @RequestMapping("/monitor/online")
+@Api(hidden = true)
 public class OnlineUserController {
 
     @Resource

+ 10 - 1
nb-admin/src/main/java/com/nb/admin/controller/system/SysLoginController.java

@@ -13,6 +13,7 @@ import com.nb.framework.web.service.IUserService;
 import com.nb.system.common.vo.AccountInfoVO;
 import com.nb.system.entity.SysUser;
 import com.nb.system.service.ISysUserService;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -30,6 +31,7 @@ import javax.annotation.Resource;
  * @author Kevin
  */
 @RestController
+@Api(tags = "登录接口")
 public class SysLoginController {
 
     @Resource
@@ -39,6 +41,7 @@ public class SysLoginController {
     ISysUserService sysUserService;
     @Log(title = "登录")
     @PostMapping("/login")
+    @ApiOperation("登录")
     public R login(@Validated @RequestBody LoginDTO req) {
         String token = userService.login(req);
 
@@ -63,31 +66,36 @@ public class SysLoginController {
                         .set(SysUser::getPassword,encryptPassword));
         return R.success(true);
     }
-    @Log(title = "获取用户信息")
+    @Log(title = "获取当前用户信息")
+    @ApiOperation("获取当前用户信息")
     @GetMapping("/getUserInfo")
     public R getUserInfo() {
         return R.success(userService.getUserInfo());
     }
 
     @Log(title = "获取权限集合")
+    @ApiOperation("获取当前用户权限集合")
     @GetMapping("/getPermCode")
     public R getPermCode() {
         return R.success(userService.getPermCode());
     }
 
     @Log(title = "获取菜单集合")
+    @ApiOperation("获取当前用户菜单集合")
     @GetMapping("/getMenuList")
     public R getMenuList() {
         return R.success(userService.getMenuList());
     }
 
     @Log(title = "获取账户信息")
+    @ApiOperation("获取当前用户账户信息")
     @GetMapping("/getAccountInfo")
     public R getAccountInfo() {
         return R.success(userService.getAccountInfo());
     }
 
     @Log(title = "保存用户信息")
+    @ApiOperation("保存用户信息")
     @PostMapping("/saveAccountInfo")
     public R saveAccountInfo(@Validated @RequestBody AccountInfoVO req) {
         userService.saveAccountInfo(req);
@@ -95,6 +103,7 @@ public class SysLoginController {
     }
 
     @Log(title = "退出")
+    @ApiOperation("用户登出")
     @PostMapping("/logout")
     public R logout() {
         StpUtil.logout();

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

@@ -32,7 +32,7 @@ public class SaTokenConfig {
     private static final List<String> IGNORE_URL = Lists.newArrayList();
 
     static {
-        IGNORE_URL.add("/api/druid/**");
+        IGNORE_URL.add("/bus/app/page");
         IGNORE_URL.add("/druid/**");
         IGNORE_URL.add("/favicon.ico");
         IGNORE_URL.add("/sys/app/get");

+ 3 - 4
nb-framework/src/main/java/com/nb/framework/config/SwaggerConfig.java

@@ -25,7 +25,7 @@ import java.util.*;
 @Configuration
 @EnableKnife4j
 @EnableSwagger2WebMvc
-@Profile("dev")
+//@Profile("dev")
 public class SwaggerConfig implements WebMvcConfigurer {
 
     public static final String VERSION = "1.0.0";
@@ -43,6 +43,7 @@ public class SwaggerConfig implements WebMvcConfigurer {
     }
 
     @Bean
+    @Profile("dev")
     public Docket system(){
         return new Docket(DocumentationType.SWAGGER_2)
                 .select()
@@ -95,9 +96,7 @@ public class SwaggerConfig implements WebMvcConfigurer {
 
     private List<SecurityScheme> security() {
         return Arrays.asList(new ApiKey("BASE_TOKEN", "Authorization",   In.HEADER.toValue()),
-                new ApiKey("租户id", "Tenant-Id",   In.HEADER.toValue()),
-                new ApiKey("签名", "Sign",   In.HEADER.toValue()),
-                new ApiKey("时间戳", "Timestamp",   In.HEADER.toValue()));
+                new ApiKey("租户id", "Tenant-Id",   In.HEADER.toValue()));
     }
 
     /**

+ 93 - 39
nb-system/src/main/java/com/nb/bus/stats/analyse/AlarmStatsAnalyse.java

@@ -3,6 +3,7 @@ package com.nb.bus.stats.analyse;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.text.CharSequenceUtil;
 import com.nb.bus.enums.DeviceAlarmEnum;
+import com.nb.bus.enums.FlowStatusEnum;
 import com.nb.bus.enums.StatsAnalyseEnum;
 import com.nb.bus.enums.StatsTimeUnit;
 import com.nb.bus.service.LocalBusInfusionHistoryService;
@@ -73,8 +74,8 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
      * @return LineResult
      */
     private LineResult alarmScatter(Map<String, List<CombineAlarmResult>> groupByTime) {
-        LineResult<BigDecimal> result = LineResult.of("alarmScatter", false, false, true,"报警均数走势分析图");
-        LineResult.LineContent<BigDecimal> scatterLine = new LineResult.LineContent("报警均值");
+        LineResult<BigDecimal> result = LineResult.of("alarmScatter", false, false, true,"提示均数走势分析图");
+        LineResult.LineContent<BigDecimal> scatterLine = new LineResult.LineContent("提示均值");
         AlarmScatter alarmScatter = new AlarmScatter();
         groupByTime.forEach((timeRange,combineResults)->{
             for (CombineAlarmResult combineResult : combineResults) {
@@ -112,7 +113,7 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
      * @return LineResult
      */
     private LineResult ratioLine(Map<String, List<CombineAlarmResult>> results) {
-        LineResult<BigDecimal> result =LineResult.of("ratio",true,false,"报警率分布图");
+        LineResult<BigDecimal> result =LineResult.of("ratio",true,false,"提示率分布图");
         List<String> time = result.getTime();
         Map<String, AlarmTotalPieResult> groupByTime = new HashMap<>();
         //根据时间区间对镇痛方式进行统计
@@ -125,25 +126,37 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
         Map<String, LineResult.LineContent<BigDecimal>> lineContentMap=new HashMap<>();
         groupByTime.forEach((timeRange,totalResult)->{
             BigDecimal total = BigDecimal.valueOf(totalResult.getTotal());
-            lineContentMap.computeIfAbsent("堵塞率",k->new LineResult.LineContent<>("堵塞")).getValue()
+            lineContentMap.computeIfAbsent("堵塞率",k->new LineResult.LineContent<>(DeviceAlarmEnum.Jam.getText())).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getJam().getValue()),total));
-            lineContentMap.computeIfAbsent("极限率",k->new LineResult.LineContent<>("极限")).getValue()
+            lineContentMap.computeIfAbsent("极限率",k->new LineResult.LineContent<>(DeviceAlarmEnum.Limit.getText())).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getLimit().getValue()),total));
-            lineContentMap.computeIfAbsent("未装药盒率",k->new LineResult.LineContent<>("未装药盒")).getValue()
+            lineContentMap.computeIfAbsent("未装药盒率",k->new LineResult.LineContent<>(DeviceAlarmEnum.NotBox.getText())).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getNoBox().getValue()),total));
-            lineContentMap.computeIfAbsent("电机失控率",k->new LineResult.LineContent<>("电机失控")).getValue()
+            lineContentMap.computeIfAbsent("电机失控率",k->new LineResult.LineContent<>(DeviceAlarmEnum.OutOfControl.getText())).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getOutOfControl().getValue()),total));
             lineContentMap.computeIfAbsent("镇痛不足率",k->new LineResult.LineContent<>("镇痛不足")).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getAnalgesicPoor().getValue()),total));
             lineContentMap.computeIfAbsent("不在服务区率",k->new LineResult.LineContent<>("不在服务区")).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getNoSignal().getValue()),total));
-            lineContentMap.computeIfAbsent("机械故障率",k->new LineResult.LineContent<>("机械故障")).getValue()
+            lineContentMap.computeIfAbsent("机械故障率",k->new LineResult.LineContent<>(DeviceAlarmEnum.Machine.getText())).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getMachine().getValue()),total));
-            lineContentMap.computeIfAbsent("电量耗尽率",k->new LineResult.LineContent<>("电量耗尽")).getValue()
+            lineContentMap.computeIfAbsent("电量率",k->new LineResult.LineContent<>("电量")).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getLowBattery().getValue()),total));
-            lineContentMap.computeIfAbsent("气泡无液率",k->new LineResult.LineContent<>("气泡无液")).getValue()
+            lineContentMap.computeIfAbsent("气泡无液率",k->new LineResult.LineContent<>(DeviceAlarmEnum.Bubble.getText())).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getBubble().getValue()),total));
-            lineContentMap.computeIfAbsent("低输注率",k->new LineResult.LineContent<>("低输注")).getValue()
+            lineContentMap.computeIfAbsent("输注总量报警率",k->new LineResult.LineContent<>(DeviceAlarmEnum.InfusionMax.getText())).getValue()
+                    .add(computeRatio(BigDecimal.valueOf(totalResult.getInfusionMax().getValue()),total));
+
+            //智能泵专属
+            lineContentMap.computeIfAbsent("加档率",k->new LineResult.LineContent<>(FlowStatusEnum.Up.getText())).getValue()
+                    .add(computeRatio(BigDecimal.valueOf(totalResult.getFlowUp().getValue()),total));
+            lineContentMap.computeIfAbsent("减档率",k->new LineResult.LineContent<>(FlowStatusEnum.Down.getText())).getValue()
+                    .add(computeRatio(BigDecimal.valueOf(totalResult.getFlowDown().getValue()),total));
+            lineContentMap.computeIfAbsent("流速已达上限率",k->new LineResult.LineContent<>(FlowStatusEnum.MaxFlow.getText())).getValue()
+                    .add(computeRatio(BigDecimal.valueOf(totalResult.getFlowMax().getValue()),total));
+            lineContentMap.computeIfAbsent("加档受限率",k->new LineResult.LineContent<>(FlowStatusEnum.Limited.getText())).getValue()
+                    .add(computeRatio(BigDecimal.valueOf(totalResult.getFlowLimited().getValue()),total));
+            lineContentMap.computeIfAbsent("低输注率",k->new LineResult.LineContent<>(FlowStatusEnum.Lowest.getText())).getValue()
                     .add(computeRatio(BigDecimal.valueOf(totalResult.getLowInfusion().getValue()),total));
         });
         result.setContent(new ArrayList<>(lineContentMap.values()));
@@ -158,7 +171,7 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
      * @return LineResult
      */
     private LineResult countLine(Map<String, List<CombineAlarmResult>> results) {
-        LineResult<Long> result = LineResult.of("count",false,false,"报警次数分布图");
+        LineResult<Long> result = LineResult.of("count",false,false,"提示次数分布图");
         List<String> time = result.getTime();
         Map<String, AlarmTotalPieResult> groupByTime = new HashMap<>();
         //根据时间区间对镇痛方式进行统计
@@ -170,16 +183,23 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
         //将每一时区的报警数量进行分类汇总
         Map<String, LineResult.LineContent<Long>> lineContentMap=new HashMap<>();
         groupByTime.forEach((timeRange,totalResult)->{
-            lineContentMap.computeIfAbsent("堵塞",k->new LineResult.LineContent<>("堵塞")).getValue().add(totalResult.getJam().getValue());
-            lineContentMap.computeIfAbsent("极限",k->new LineResult.LineContent<>("极限")).getValue().add(totalResult.getLimit().getValue());
-            lineContentMap.computeIfAbsent("未装药盒",k->new LineResult.LineContent<>("未装药盒")).getValue().add(totalResult.getNoBox().getValue());
-            lineContentMap.computeIfAbsent("电机失控",k->new LineResult.LineContent<>("电机失控")).getValue().add(totalResult.getOutOfControl().getValue());
+            lineContentMap.computeIfAbsent(DeviceAlarmEnum.Jam.getText(),k->new LineResult.LineContent<>(DeviceAlarmEnum.Jam.getText())).getValue().add(totalResult.getJam().getValue());
+            lineContentMap.computeIfAbsent(DeviceAlarmEnum.Limit.getText(),k->new LineResult.LineContent<>(DeviceAlarmEnum.Limit.getText())).getValue().add(totalResult.getLimit().getValue());
+            lineContentMap.computeIfAbsent(DeviceAlarmEnum.NotBox.getText(),k->new LineResult.LineContent<>(DeviceAlarmEnum.NotBox.getText())).getValue().add(totalResult.getNoBox().getValue());
+            lineContentMap.computeIfAbsent(DeviceAlarmEnum.OutOfControl.getText(),k->new LineResult.LineContent<>(DeviceAlarmEnum.OutOfControl.getText())).getValue().add(totalResult.getOutOfControl().getValue());
             lineContentMap.computeIfAbsent("镇痛不足",k->new LineResult.LineContent<>("镇痛不足")).getValue().add(totalResult.getAnalgesicPoor().getValue());
             lineContentMap.computeIfAbsent("不在服务区",k->new LineResult.LineContent<>("不在服务区")).getValue().add(totalResult.getNoSignal().getValue());
-            lineContentMap.computeIfAbsent("机械故障",k->new LineResult.LineContent<>("机械故障")).getValue().add(totalResult.getMachine().getValue());
-            lineContentMap.computeIfAbsent("电量耗尽",k->new LineResult.LineContent<>("电量耗尽")).getValue().add(totalResult.getLowBattery().getValue());
-            lineContentMap.computeIfAbsent("气泡无液",k->new LineResult.LineContent<>("气泡无液")).getValue().add(totalResult.getBubble().getValue());
-            lineContentMap.computeIfAbsent("低输注",k->new LineResult.LineContent<>("低输注")).getValue().add(totalResult.getLowInfusion().getValue());
+            lineContentMap.computeIfAbsent(DeviceAlarmEnum.Machine.getText(),k->new LineResult.LineContent<>(DeviceAlarmEnum.Machine.getText())).getValue().add(totalResult.getMachine().getValue());
+            lineContentMap.computeIfAbsent("低电量",k->new LineResult.LineContent<>("低电量")).getValue().add(totalResult.getLowBattery().getValue());
+            lineContentMap.computeIfAbsent(DeviceAlarmEnum.Bubble.getText(),k->new LineResult.LineContent<>(DeviceAlarmEnum.Bubble.getText())).getValue().add(totalResult.getBubble().getValue());
+            lineContentMap.computeIfAbsent(DeviceAlarmEnum.InfusionMax.getText(),k->new LineResult.LineContent<>(DeviceAlarmEnum.InfusionMax.getText())).getValue().add(totalResult.getLowInfusion().getValue());
+
+            //智能泵专属
+            lineContentMap.computeIfAbsent(FlowStatusEnum.Up.getText(), k->new LineResult.LineContent<>(FlowStatusEnum.Up.getText())).getValue().add(totalResult.getFlowUp().getValue());
+            lineContentMap.computeIfAbsent(FlowStatusEnum.Down.getText(),k->new LineResult.LineContent<>(FlowStatusEnum.Down.getText())).getValue().add(totalResult.getFlowDown().getValue());
+            lineContentMap.computeIfAbsent(FlowStatusEnum.MaxFlow.getText(),k->new LineResult.LineContent<>(FlowStatusEnum.MaxFlow.getText())).getValue().add(totalResult.getFlowMax().getValue());
+            lineContentMap.computeIfAbsent(FlowStatusEnum.Limited.getText(),k->new LineResult.LineContent<>(FlowStatusEnum.Limited.getText())).getValue().add(totalResult.getFlowLimited().getValue());
+            lineContentMap.computeIfAbsent(FlowStatusEnum.Lowest.getText(),k->new LineResult.LineContent<>(FlowStatusEnum.Lowest.getText())).getValue().add(totalResult.getLowInfusion().getValue());
         });
         result.setContent(new ArrayList<>(lineContentMap.values()));
         result.setSampleCount(CollUtil.size(results));
@@ -193,8 +213,28 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
         TableResult result = new TableResult();
         //根据时间对结果进行区分统计
         Map<String, List<CombineAlarmResult>> groupByTimeResults = groupByTime(results, unit);
+        List<String> columnNames = Arrays.asList(
+                DeviceAlarmEnum.Jam.getText(),
+                DeviceAlarmEnum.Limit.getText(),
+                DeviceAlarmEnum.NotBox.getText(),
+                DeviceAlarmEnum.OutOfControl.getText(),
+                "镇痛不足",
+                "不在服务区",
+                DeviceAlarmEnum.Machine.getText(),
+                "低电量",
+                DeviceAlarmEnum.Bubble.getText(),
+                DeviceAlarmEnum.InfusionMax.getText());
+        //智能泵专属
+        columnNames=CollUtil.unionAll(columnNames,Arrays.asList(
+                FlowStatusEnum.Up.getText(),
+                FlowStatusEnum.Down.getText(),
+                FlowStatusEnum.MaxFlow.getText(),
+                FlowStatusEnum.Limited.getText(),
+                FlowStatusEnum.Lowest.getText()
+        ));
         //顺序不可错! 先数量后比率
-        List<StatsColumn> allColumn = getAllColumn(Arrays.asList("堵塞","极限","未装药盒","电机失控","镇痛不足","不在服务区","机械故障","电量耗尽","气泡无液","输入总量报警","低输注"));
+        List<StatsColumn> allColumn = getAllColumn(columnNames);
+
         allColumn.add(1,StatsColumn.of("输注总数","输注总数"));
         allColumn.add(2,StatsColumn.of("提示总数","提示总数"));
         List<Map<String, Object>> contents = new ArrayList<>();
@@ -215,28 +255,42 @@ public class AlarmStatsAnalyse implements CommonStats<CombineAlarmResult> {
             contentValues.put("时间",timeRange);
             contentValues.put("输注总数",totalResult.getInfusionCount());
             contentValues.put("提示总数",total);
-            contentValues.put("堵塞",totalResult.getJam().getValue());
-            contentValues.put("极限",totalResult.getLimit().getValue());
-            contentValues.put("未装药盒",totalResult.getNoBox().getValue());
-            contentValues.put("电机失控",totalResult.getOutOfControl().getValue());
+            contentValues.put( DeviceAlarmEnum.Jam.getText(),totalResult.getJam().getValue());
+            contentValues.put( DeviceAlarmEnum.Limit.getText(),totalResult.getLimit().getValue());
+            contentValues.put(DeviceAlarmEnum.NotBox.getText(),totalResult.getNoBox().getValue());
+            contentValues.put(DeviceAlarmEnum.OutOfControl.getText(),totalResult.getOutOfControl().getValue());
             contentValues.put("镇痛不足",totalResult.getAnalgesicPoor().getValue());
             contentValues.put("不在服务区",totalResult.getNoSignal().getValue());
-            contentValues.put("机械故障",totalResult.getMachine().getValue());
-            contentValues.put("电量耗尽",totalResult.getLowBattery().getValue());
-            contentValues.put("气泡无液",totalResult.getBubble().getValue());
-            contentValues.put("低输注",totalResult.getLowInfusion().getValue());
-            contentValues.put("输入总量报警",totalResult.getInfusionMax().getValue());
-            contentValues.put("堵塞比率",computeRatio(BigDecimal.valueOf(totalResult.getJam().getValue()),total));
-            contentValues.put("极限比率",computeRatio(BigDecimal.valueOf(totalResult.getLimit().getValue()),total));
-            contentValues.put("未装药盒比率",computeRatio(BigDecimal.valueOf(totalResult.getNoBox().getValue()),total));
-            contentValues.put("电机失控比率",computeRatio(BigDecimal.valueOf(totalResult.getOutOfControl().getValue()),total));
+            contentValues.put(DeviceAlarmEnum.Machine.getText(),totalResult.getMachine().getValue());
+            contentValues.put("电量",totalResult.getLowBattery().getValue());
+            contentValues.put(DeviceAlarmEnum.Bubble.getText(),totalResult.getBubble().getValue());
+            contentValues.put(DeviceAlarmEnum.InfusionMax.getText(),totalResult.getInfusionMax().getValue());
+
+            contentValues.put(DeviceAlarmEnum.Jam.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getJam().getValue()),total));
+            contentValues.put(DeviceAlarmEnum.Limit.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getLimit().getValue()),total));
+            contentValues.put(DeviceAlarmEnum.NotBox.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getNoBox().getValue()),total));
+            contentValues.put(DeviceAlarmEnum.OutOfControl.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getOutOfControl().getValue()),total));
             contentValues.put("镇痛不足比率",computeRatio(BigDecimal.valueOf(totalResult.getAnalgesicPoor().getValue()),total));
             contentValues.put("不在服务区比率",computeRatio(BigDecimal.valueOf(totalResult.getNoSignal().getValue()),total));
-            contentValues.put("机械故障比率",computeRatio(BigDecimal.valueOf(totalResult.getMachine().getValue()),total));
-            contentValues.put("电量耗尽比率",computeRatio(BigDecimal.valueOf(totalResult.getLowBattery().getValue()),total));
-            contentValues.put("气泡无液比率",computeRatio(BigDecimal.valueOf(totalResult.getBubble().getValue()),total));
-            contentValues.put("低输注比率",computeRatio(BigDecimal.valueOf(totalResult.getLowInfusion().getValue()),total));
-            contentValues.put("输入总量报警比率",computeRatio(BigDecimal.valueOf(totalResult.getInfusionMax().getValue()),total));
+            contentValues.put(DeviceAlarmEnum.Machine.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getMachine().getValue()),total));
+            contentValues.put("低电量比率",computeRatio(BigDecimal.valueOf(totalResult.getLowBattery().getValue()),total));
+            contentValues.put(DeviceAlarmEnum.Bubble.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getBubble().getValue()),total));
+            contentValues.put(DeviceAlarmEnum.InfusionMax.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getInfusionMax().getValue()),total));
+
+            //智能泵专属
+            contentValues.put( FlowStatusEnum.Up.getText(),totalResult.getFlowUp().getValue());
+            contentValues.put( FlowStatusEnum.Down.getText(),totalResult.getFlowDown().getValue());
+            contentValues.put(FlowStatusEnum.Limited.getText(),totalResult.getFlowLimited().getValue());
+            contentValues.put(FlowStatusEnum.MaxFlow.getText(),totalResult.getFlowMax().getValue());
+            contentValues.put(FlowStatusEnum.Lowest.getText(),totalResult.getLowInfusion().getValue());
+
+            contentValues.put( FlowStatusEnum.Up.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getFlowUp().getValue()),total));
+            contentValues.put( FlowStatusEnum.Down.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getFlowDown().getValue()),total));
+            contentValues.put(FlowStatusEnum.Limited.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getFlowLimited().getValue()),total));
+            contentValues.put(FlowStatusEnum.MaxFlow.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getFlowMax().getValue()),total));
+            contentValues.put(FlowStatusEnum.Lowest.getText()+"比率",computeRatio(BigDecimal.valueOf(totalResult.getLowInfusion().getValue()),total));
+
+
             contents.add(contentValues);
         });
         return Arrays.asList(result);

+ 1 - 1
nb-system/src/main/java/com/nb/bus/stats/analyse/EvalStatsAnalyse.java

@@ -52,7 +52,7 @@ public class EvalStatsAnalyse implements CommonStats<CombineEvalResult> {
 
     @Override
     public List<PieResult> handlePie(List<CombineEvalResult> results) {
-        PieResult result = PieResult.of(PieEnum.total.name(),PieEnum.total.getText());
+        PieResult result = PieResult.of(PieEnum.total.name(),"评价分析饼图");
         //keys由历史数据和常量维护信息表并集构成
         BusHospitalConfigEntity config = evalConfig();
         if(config==null){

+ 1 - 1
nb-system/src/main/java/com/nb/bus/stats/analyse/PcaStatsAnalyse.java

@@ -40,7 +40,7 @@ public class PcaStatsAnalyse implements CommonStats<CombineResult> {
 
     @Override
     public List<PieResult> handlePie(List<CombineResult> results) {
-        PieResult result = PieResult.of(PieEnum.total.name(),PieEnum.total.getText());
+        PieResult result = PieResult.of(PieEnum.total.name(),"自控分析饼图");
         long total=0;
         long pcaValidTotalCount=0;
         long pcaInvalidTotalCount=0;

+ 65 - 11
nb-system/src/main/java/com/nb/bus/stats/entity/AlarmScatter.java

@@ -20,7 +20,7 @@ import java.util.Optional;
  */
 public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter.AlarmStatsByTime>> {
     public AlarmScatter.AlarmStatsByTime getJam(String time) {
-        return this.computeIfAbsent("堵塞",k->new LinkedHashMap<>())
+        return this.computeIfAbsent(DeviceAlarmEnum.Jam.getText(),k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -29,7 +29,7 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
     }
 
     public  AlarmScatter.AlarmStatsByTime getLimit(String time) {
-        return this.computeIfAbsent("极限",k->new LinkedHashMap<>())
+        return this.computeIfAbsent(DeviceAlarmEnum.Limit.getText(),k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -38,7 +38,7 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
     }
 
     public  AlarmScatter.AlarmStatsByTime getNoBox(String time) {
-        return this.computeIfAbsent("未装药盒",k->new LinkedHashMap<>())
+        return this.computeIfAbsent(DeviceAlarmEnum.NotBox.getText(),k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -47,7 +47,7 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
     }
 
     public AlarmScatter.AlarmStatsByTime getOutOfControl(String time) {
-        return this.computeIfAbsent("电机失控",k->new LinkedHashMap<>())
+        return this.computeIfAbsent(DeviceAlarmEnum.OutOfControl.getText(),k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -67,7 +67,7 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
     }
 
     public AlarmScatter.AlarmStatsByTime getNoSignal(String time) {
-        return this.computeIfAbsent("不在服务区",k->new LinkedHashMap<>())
+        return this.computeIfAbsent(DeviceStatusEnum.NoSignal.getText(),k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -77,7 +77,7 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
 
 
     public AlarmScatter.AlarmStatsByTime getMachine(String time) {
-        return this.computeIfAbsent("机械故障",k->new LinkedHashMap<>())
+        return this.computeIfAbsent(DeviceAlarmEnum.Machine.getText(),k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -86,7 +86,7 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
     }
 
     public AlarmScatter.AlarmStatsByTime getLowBattery(String time) {
-        return this.computeIfAbsent("电量耗尽",k->new LinkedHashMap<>())
+        return this.computeIfAbsent("电量",k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -96,7 +96,7 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
     }
 
     public AlarmScatter.AlarmStatsByTime getBubble(String time) {
-        return this.computeIfAbsent("气泡无液",k->new LinkedHashMap<>())
+        return this.computeIfAbsent(DeviceAlarmEnum.Bubble.getText(),k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -114,8 +114,46 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
         incrementValue(this.getLowInfusion(time));
     }
 
+    public AlarmScatter.AlarmStatsByTime getFlowLimited(String time) {
+        return this.computeIfAbsent(FlowStatusEnum.Limited.getText(),k->new LinkedHashMap<>())
+                .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
+    }
+
+    public void incrementFlowLimited(String time) {
+        incrementValue(this.getFlowLimited(time));
+    }
+
+    public AlarmScatter.AlarmStatsByTime getFlowMax(String time) {
+        return this.computeIfAbsent(FlowStatusEnum.MaxFlow.getText(),k->new LinkedHashMap<>())
+                .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
+    }
+
+    public void incrementFlowMax(String time) {
+        incrementValue(this.getFlowMax(time));
+    }
+
+
+    public AlarmScatter.AlarmStatsByTime getFlowUp(String time) {
+        return this.computeIfAbsent(FlowStatusEnum.Up.getText(),k->new LinkedHashMap<>())
+                .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
+    }
+
+    public void incrementFlowUp(String time) {
+        incrementValue(this.getFlowUp(time));
+    }
+
+
+    public AlarmScatter.AlarmStatsByTime  getFlowDown(String time) {
+        return this.computeIfAbsent(FlowStatusEnum.Up.getText(),k->new LinkedHashMap<>())
+                .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
+    }
+
+    public void incrementFlowDown(String time) {
+        incrementValue(this.getFlowDown(time));
+    }
+
     public AlarmScatter.AlarmStatsByTime getInfusionMax(String time) {
-        return this.computeIfAbsent("输入总量报警",k->new LinkedHashMap<>())
+        return this.computeIfAbsent(DeviceAlarmEnum.InfusionMax.getText(),k->new LinkedHashMap<>())
                 .computeIfAbsent(time,t->AlarmStatsByTime.of(time,0));
     }
 
@@ -170,8 +208,24 @@ public class AlarmScatter extends LinkedHashMap<String, Map<String, AlarmScatter
                 incrementNoSignal(time);
             }
             FlowStatusEnum warnFlow = alarmResult.getWarnFlow();
-            if (FlowStatusEnum.Lowest.equals(warnFlow)) {
-                incrementLowInfusion(time);
+            if(warnFlow!=null){
+                switch (warnFlow){
+                    case Up:
+                        incrementFlowUp(time);
+                        break;
+                    case Down:
+                        incrementFlowDown(time);
+                        break;
+                    case Lowest:
+                        incrementLowInfusion(time);
+                        break;
+                    case Limited:
+                        incrementFlowLimited(time);
+                        break;
+                    case MaxFlow:
+                        incrementFlowMax(time);
+                    default:break;
+                }
             }
 
         }

+ 76 - 16
nb-system/src/main/java/com/nb/bus/stats/entity/AlarmTotalPieResult.java

@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.Setter;
+import org.intellij.lang.annotations.Flow;
 
 import java.util.HashMap;
 
@@ -31,7 +32,7 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
     private long infusionCount;
 
     public PieContent getJam() {
-        return this.computeIfAbsent("jam",k->PieContent.of("堵塞",0L));
+        return this.computeIfAbsent("jam",k->PieContent.of(DeviceAlarmEnum.Jam.getText(),0L));
     }
 
     public void incrementJam() {
@@ -39,7 +40,7 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
     }
 
     public PieContent getLimit() {
-        return this.computeIfAbsent("limit",k->PieContent.of("极限",0L));
+        return this.computeIfAbsent("limit",k->PieContent.of(DeviceAlarmEnum.Limit.getText(),0L));
     }
 
     public void incrementLimit() {
@@ -47,7 +48,7 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
     }
 
     public PieContent getNoBox() {
-        return this.computeIfAbsent("noBox",k->PieContent.of("未装药盒",0L));
+        return this.computeIfAbsent("noBox",k->PieContent.of(DeviceAlarmEnum.NotBox.getText(),0L));
     }
 
     public void incrementNoBox() {
@@ -55,7 +56,7 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
     }
 
     public PieContent getOutOfControl() {
-        return this.computeIfAbsent("outOfControl",k->PieContent.of("电机失控",0L));
+        return this.computeIfAbsent("outOfControl",k->PieContent.of(DeviceAlarmEnum.OutOfControl.getText(),0L));
     }
 
     public void incrementOutOfControl() {
@@ -73,7 +74,7 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
     }
 
     public PieContent getNoSignal() {
-        return this.computeIfAbsent("noSignal",k->PieContent.of("不在服务区",0L));
+        return this.computeIfAbsent("noSignal",k->PieContent.of(DeviceStatusEnum.NoSignal.getText(),0L));
     }
 
     public void incrementNoSignal() {
@@ -82,7 +83,7 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
 
 
     public PieContent getMachine() {
-        return this.computeIfAbsent("machine",k->PieContent.of("机械故障",0L));
+        return this.computeIfAbsent("machine",k->PieContent.of(DeviceAlarmEnum.Machine.getText(),0L));
     }
 
     public void incrementMachine() {
@@ -90,7 +91,7 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
     }
 
     public PieContent getLowBattery() {
-        return this.computeIfAbsent("lowBattery",k->PieContent.of("电量耗尽",0L));
+        return this.computeIfAbsent("lowBattery",k->PieContent.of("电量",0L));
     }
 
 
@@ -99,7 +100,7 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
     }
 
     public PieContent getBubble() {
-        return this.computeIfAbsent("bubble",k->PieContent.of("气泡无液",0L));
+        return this.computeIfAbsent("bubble",k->PieContent.of(DeviceAlarmEnum.Bubble.getText(),0L));
     }
 
 
@@ -107,20 +108,55 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
         incrementValue(this.getBubble());
     }
 
+    public PieContent getInfusionMax() {
+        return this.computeIfAbsent("infusionMax",k->PieContent.of(DeviceAlarmEnum.InfusionMax.getText(),0L));
+    }
+
+    public void incrementInfusionMax() {
+        incrementValue(this.getInfusionMax());
+    }
+
+    //智能泵专有提示
     public PieContent getLowInfusion() {
-        return this.computeIfAbsent("lowInfusion",k->PieContent.of("低输注状态",0L));
+        return this.computeIfAbsent("lowInfusion",k->PieContent.of(FlowStatusEnum.Lowest.getText(),0L));
     }
 
     public void incrementLowInfusion() {
         incrementValue(this.getLowInfusion());
     }
 
-    public PieContent getInfusionMax() {
-        return this.computeIfAbsent("infusionMax",k->PieContent.of("输入总量报警",0L));
+    public PieContent getFlowLimited() {
+        return this.computeIfAbsent("flowLimited",k->PieContent.of(FlowStatusEnum.Limited.getText(),0L));
     }
 
-    public void incrementInfusionMax() {
-        incrementValue(this.getInfusionMax());
+    public void incrementFlowLimited() {
+        incrementValue(this.getFlowLimited());
+    }
+
+    public PieContent getFlowMax() {
+        return this.computeIfAbsent("flowMax",k->PieContent.of(FlowStatusEnum.MaxFlow.getText(),0L));
+    }
+
+    public void incrementFlowMax() {
+        incrementValue(this.getFlowMax());
+    }
+
+
+    public PieContent getFlowUp() {
+        return this.computeIfAbsent("flowUp",k->PieContent.of(FlowStatusEnum.Up.getText(),0L));
+    }
+
+    public void incrementFlowUp() {
+        incrementValue(this.getFlowUp());
+    }
+
+
+    public PieContent getFlowDown() {
+        return this.computeIfAbsent("flowDown",k->PieContent.of(FlowStatusEnum.Down.getText(),0L));
+    }
+
+    public void incrementFlowDown() {
+        incrementValue(this.getFlowDown());
     }
 
     private void incrementValue(PieContent pieContent){
@@ -132,11 +168,19 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
         getJam();
         getLimit();
         getNoBox();
-        getMachine();
         getOutOfControl();
+        getAnalgesicPoor();
+        getNoSignal();
+        getMachine();
         getLowBattery();
         getBubble();
         getInfusionMax();
+        //智能泵专属
+        getLowInfusion();
+        getFlowLimited();
+        getFlowMax();
+        getFlowDown();
+        getFlowUp();
     }
 
     public void handle(CombineAlarmResult alarmResult) {
@@ -179,8 +223,24 @@ public class AlarmTotalPieResult extends HashMap<String,PieContent> {
                 incrementNoSignal();
             }
             FlowStatusEnum warnFlow = alarmResult.getWarnFlow();
-            if (FlowStatusEnum.Lowest.equals(warnFlow)) {
-                incrementLowInfusion();
+            if(warnFlow!=null){
+                switch (warnFlow){
+                    case Up:
+                        incrementFlowUp();
+                        break;
+                    case Down:
+                        incrementFlowDown();
+                        break;
+                    case Lowest:
+                        incrementLowInfusion();
+                        break;
+                    case Limited:
+                        incrementFlowLimited();
+                        break;
+                    case MaxFlow:
+                        incrementFlowMax();
+                        default:break;
+                }
             }
 
         }

+ 1 - 1
nb-system/src/main/java/com/nb/bus/stats/enums/PieEnum.java

@@ -13,6 +13,6 @@ import lombok.Getter;
 @AllArgsConstructor
 @Getter
 public enum  PieEnum {
-    total("总量饼图");
+    total("提示分析饼图");
     private String text;
 }

+ 1 - 1
nb-system/src/main/java/com/nb/bus/stats/report/AgeStatsReport.java

@@ -62,7 +62,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());
+        PieResult result = PieResult.of(PieEnum.total.name(),"年龄分析饼图");
         Map<AgeStatsEnum, Integer> ageMap = new EnumMap< >(AgeStatsEnum.class);
         for (AgeStatsEnum value : AgeStatsEnum.values()) {
             ageMap.put(value,0);

+ 1 - 1
nb-system/src/main/java/com/nb/bus/stats/report/AnalStatsAnalyse.java

@@ -53,7 +53,7 @@ public class AnalStatsAnalyse implements CommonStats<CombineResult> {
 
     @Override
     public List<PieResult> handlePie(List<CombineResult> results) {
-        PieResult result = PieResult.of(PieEnum.total.name(),PieEnum.total.getText());
+        PieResult result = PieResult.of(PieEnum.total.name(),"镇痛分析饼图");
         //keys由历史数据和常量维护信息表并集构成
         Map<String, Long> analMaps = groupByAnal(results);
         List<String> allAnal = getAllAnalName(analMaps, getConAnal());

+ 1 - 1
nb-system/src/main/java/com/nb/bus/stats/report/AsaStatsReport.java

@@ -54,7 +54,7 @@ public class AsaStatsReport implements CommonStats<CombineResult> {
 
     @Override
     public List<PieResult> handlePie(List<CombineResult> results) {
-        PieResult result = PieResult.of(PieEnum.total.name(),PieEnum.total.getText());
+        PieResult result = PieResult.of(PieEnum.total.name(),"asa分析饼图");
         List<BusConMixEntity> conAsa = getConAsa();
         Map<String, Long> asaMap =groupByAsa(results);
         for (BusConMixEntity busConMixEntity : conAsa) {

+ 1 - 1
nb-system/src/main/java/com/nb/bus/stats/report/GenderStatsReport.java

@@ -46,7 +46,7 @@ public class GenderStatsReport implements CommonStats<CombineResult> {
 
     @Override
     public List<PieResult> handlePie(List<CombineResult> results) {
-        PieResult result = PieResult.of(PieEnum.total.name(),PieEnum.total.getText());
+        PieResult result = PieResult.of(PieEnum.total.name(),"性别分析饼图");
         long man=0;
         long woman=0;
         long unkown=0;

+ 1 - 1
nb-system/src/main/java/com/nb/bus/stats/report/WeightStatsReport.java

@@ -91,7 +91,7 @@ public class WeightStatsReport implements CommonStats<CombineResult> {
      * @return PieResult
      */
     private PieResult totalPie(List<CombineResult> results) {
-        PieResult result = PieResult.of(PieEnum.total.name(),PieEnum.total.getText());
+        PieResult result = PieResult.of(PieEnum.total.name(),"体重分析饼图");
         Map<WeightRangeEnum, Integer> ageMap = new EnumMap<>(WeightRangeEnum.class);
         for (WeightRangeEnum value : WeightRangeEnum.values()) {
             ageMap.put(value,0);