Przeglądaj źródła

add 宣教配置
add 设备报警处理

18339543638 3 lat temu
rodzic
commit
c6046a8ffe

+ 0 - 1
coffee-admin/src/test/java/com/coffee/admin/BusNetpumpTest.java

@@ -38,7 +38,6 @@ public class BusNetpumpTest {
         netPumpEntity.setBedNo("1");
         netPumpEntity.setDeviceId("123");
         netPumpEntity.setTenantId("123");
-        netPumpEntity.setRegisterTime(new Date());
         netPumpService.updateById(netPumpEntity);
     }
 

+ 11 - 0
coffee-common/src/main/java/com/coffee/common/config/websocket/WebSocketConstant.java

@@ -30,6 +30,17 @@ public class WebSocketConstant {
         return id+"-"+productName+"-"+param+"-"+tenantId;
     }
 
+    /**
+     * 获取 设备状态变化主题
+     * @param productName
+     * @param param
+     * @param tenantId
+     * @return
+     */
+    public static String getAlarmCount(String productName,String param,String tenantId){
+        return getTopic(ALARM_COUNT,productName,param,tenantId);
+    }
+
     /**
      * 获取 设备信息变化主题
      * @param productName

+ 66 - 0
coffee-system/src/main/java/com/coffee/bus/controller/BusDocController.java

@@ -0,0 +1,66 @@
+package com.coffee.bus.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.exception.NotLoginException;
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.Mapper;
+import com.coffee.bus.entity.BusDeviceEntity;
+import com.coffee.bus.entity.BusDocEntity;
+import com.coffee.bus.service.LocalBusDeviceService;
+import com.coffee.bus.service.LocalBusDocService;
+import com.coffee.common.bo.LoginUser;
+import com.coffee.common.crud.BaseService;
+import com.coffee.common.crud.controller.BaseCrudController;
+import com.coffee.common.result.R;
+import com.coffee.common.util.SecurityUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusHospitalController.java
+ * @Description TODO
+ * @createTime 2022年03月19日 09:28:00
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/bus/doc")
+@Api(tags = "医院宣教文档",value = "该接口用于处理医院的帮助文档,统一权限前缀(bus:doc),bus:doc:add")
+public class BusDocController extends BaseCrudController<BusDocEntity, String> {
+    private final LocalBusDocService docService;
+
+
+    /**
+     * 权限控制前缀
+     * @return
+     */
+    @Override
+    public String getPermissionPrefix() {
+        return "device:reg";
+    }
+
+
+    @GetMapping("/get/{tenantId}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "tenantId",value = "医院id",required = true,example = "当前用户医院id")
+    })
+    @ApiOperation(value = "获取当前医院的宣教文档",notes = "当用户未登录、用户为系统用户、用户租户id为空时,返回值为空,权限为空")
+    public R getCurrentHospital(@PathVariable("tenantId") String tenantId){
+        return  R.success(docService.getOne(new QueryWrapper<BusDocEntity>().lambda().eq(BusDocEntity::getTenantId,tenantId)));
+    }
+
+    @Override
+    public BaseService<? extends Mapper<BusDocEntity>, BusDocEntity, String> getService() {
+        return docService;
+    }
+}

+ 19 - 2
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceAlarmEntity.java

@@ -1,9 +1,11 @@
 package com.coffee.bus.entity;
 
+import cn.hutool.core.lang.Assert;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.common.config.mybatis.DateToBigIntHandler;
+import com.coffee.common.entity.Entity;
 import com.coffee.common.entity.TenantGenericEntity;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import io.swagger.annotations.ApiModel;
@@ -14,6 +16,7 @@ import lombok.ToString;
 import org.apache.ibatis.type.EnumOrdinalTypeHandler;
 
 import java.util.Date;
+import java.util.function.Predicate;
 
 /**
  * @author lifang
@@ -44,12 +47,16 @@ public class BusDeviceAlarmEntity extends TenantGenericEntity<String,String> {
     @ApiModelProperty(value = "报警原因")
     private String cause;
 
+    @ApiModelProperty(value = "报警是否正在进行",hidden = true)
+    @JsonIgnoreProperties(allowSetters = true)
+    private Integer doing;
+
 
     @ApiModelProperty(value = "是否已处理 0、未处理,1、已处理,暂未使用")
     private Integer dealing;
 
 
-    @ApiModelProperty(value = "报警记录所绑定的历史记录id,后续用于更新操作")
+    @ApiModelProperty(value = "报警记录所绑定的历史记录id,后续用于更新操作",hidden = true)
     @JsonIgnoreProperties(allowSetters = true)
     private String deviceHistoryId;
 
@@ -58,7 +65,17 @@ public class BusDeviceAlarmEntity extends TenantGenericEntity<String,String> {
     private String clinicId;
 
 
-    @ApiModelProperty(value = "设备标识",readOnly = true)
+    @ApiModelProperty(value = "设备标识",readOnly = true,hidden = true)
     @JsonIgnoreProperties(allowSetters = true)
     private String classification;
+
+    public BusDeviceAlarmEntity(String deviceId, DeviceAlarmEnum alarm, Date alarmTime, Integer doing, String deviceHistoryId, String clinicId, String classification) {
+        this.deviceId = deviceId;
+        this.alarm = alarm;
+        this.alarmTime = alarmTime;
+        this.doing = doing;
+        this.deviceHistoryId = deviceHistoryId;
+        this.clinicId = clinicId;
+        this.classification = classification;
+    }
 }

+ 0 - 2
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceHistoryEntity.java

@@ -181,8 +181,6 @@ public class BusDeviceHistoryEntity extends TenantGenericEntity<String,String> {
         history.setTotalQuantity(pump.getTotalDose());
         history.setTotalCount(pump.getTotalCount());
         history.setRunState(pump.getRunState());
-        history.setRegisterTime(pump.getRegisterTime());
-        history.setLastUploadTime(pump.getLastUploadTime());
         history.setStartTime(pump.getStartTime());
         history.setMonitorType(pump.getMonitorType());
         history.setMaster(pump.getMaster());

+ 7 - 9
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceUsingEntity.java

@@ -34,7 +34,7 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @TableName(value = "bus_device_using",autoResultMap = true)
-@ApiModel(value="设备运行状态", description="")
+@ApiModel(value="设备运行状态", description="设备运行状态")
 public class BusDeviceUsingEntity extends TenantGenericEntity<String,String> {
 
     @ApiModelProperty(value = "网络泵id",readOnly = true)
@@ -114,7 +114,7 @@ public class BusDeviceUsingEntity extends TenantGenericEntity<String,String> {
     @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
     private Boolean warnLowBattery;
 
-    @ApiModelProperty(value = "开始时间",readOnly = true)
+    @ApiModelProperty(value = "输注开始时间,即本次运行开机时间",readOnly = true)
     @TableField(typeHandler = DateToBigIntHandler.class)
     private Date startTime;
 
@@ -125,13 +125,6 @@ public class BusDeviceUsingEntity extends TenantGenericEntity<String,String> {
     @ApiModelProperty(value = "备注")
     private String remark;
 
-    @ApiModelProperty(value = "最后上传时间",readOnly = true)
-    @TableField(typeHandler = DateToBigIntHandler.class)
-    private Date lastUploadTime;
-
-    @TableField(typeHandler = DateToBigIntHandler.class)
-    private Date registerTime;
-
     @ApiModelProperty(value = "监护类型,1、有泵监护 0、无泵监护")
     @JsonIgnoreProperties(allowSetters = true)
     private Integer monitorType;
@@ -147,4 +140,9 @@ public class BusDeviceUsingEntity extends TenantGenericEntity<String,String> {
     @ApiModelProperty(value = "泵类型",readOnly = true)
     @TableField(typeHandler = EnumOrdinalTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.NEVER)
     private DeviceEnum type;
+
+    @ApiModelProperty(value = "数据上传时间",readOnly = true,hidden = true)
+    @TableField(typeHandler = DateToBigIntHandler.class)
+    @JsonIgnoreProperties(allowSetters = true)
+    private Date uploadTime;
 }

+ 30 - 0
coffee-system/src/main/java/com/coffee/bus/entity/BusDocEntity.java

@@ -0,0 +1,30 @@
+package com.coffee.bus.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.coffee.common.entity.GenericEntity;
+import com.coffee.common.entity.TenantGenericEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusDocEntity.java
+ * @Description TODO
+ * @createTime 2022年04月09日 16:12:00
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName(value = "bus_doc",autoResultMap = true)
+@ApiModel(value="医院宣教文档管理", description="宣教文档管理")
+@ToString
+public class BusDocEntity extends TenantGenericEntity<String,String> {
+    @ApiModelProperty("文档内容")
+    @NotBlank(message = "文档内容不能为空")
+    private String content;
+}

+ 8 - 4
coffee-system/src/main/java/com/coffee/bus/listener/event/bean/DeviceAlarmEvent.java

@@ -1,32 +1,36 @@
 package com.coffee.bus.listener.event.bean;
 
+import com.coffee.bus.entity.BusDeviceAlarmEntity;
 import com.coffee.bus.entity.BusDeviceUsingEntity;
+import com.coffee.bus.enums.DeviceAlarmEnum;
 import lombok.Data;
 import lombok.Getter;
 import org.springframework.context.ApplicationEvent;
 
 import java.time.Clock;
+import java.util.Date;
 
 /**
  * @author lifang
  * @version 1.0.0
  * @ClassName DeviceAlarmEvent.java
- * @Description TODO
+ * @Description 监听设备报警事件
  * @createTime 2022年03月21日 16:44:00
  */
 
 @Getter
 public class DeviceAlarmEvent extends ApplicationEvent {
 
-    private final BusDeviceUsingEntity content;
+    private final BusDeviceAlarmEntity content;
     private final String historyId;
-    public DeviceAlarmEvent(Object source, BusDeviceUsingEntity content,String historyId) {
+
+    public DeviceAlarmEvent(Object source, BusDeviceAlarmEntity content,String historyId) {
         super(source);
         this.content=content;
         this.historyId=historyId;
     }
 
-    public DeviceAlarmEvent(Object source, BusDeviceUsingEntity content ,String historyId,Clock clock) {
+    public DeviceAlarmEvent(Object source, BusDeviceAlarmEntity content ,String historyId,Clock clock) {
         super(source, clock);
         this.content=content;
         this.historyId=historyId;

+ 17 - 0
coffee-system/src/main/java/com/coffee/bus/mapper/BusDocMapper.java

@@ -0,0 +1,17 @@
+package com.coffee.bus.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.coffee.bus.entity.BusDocEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusHospitalMapper.java
+ * @Description 设备注册信息
+ * @createTime 2022年03月19日 09:15:00
+ */
+@Mapper
+public interface BusDocMapper extends BaseMapper<BusDocEntity> {
+
+}

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

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
 import com.coffee.common.cache.ConfigStorage;
 import com.coffee.common.cache.value.Value;
 import org.springframework.cache.support.SimpleValueWrapper;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.ReflectionUtils;
 
 import java.lang.reflect.Field;

+ 32 - 0
coffee-system/src/main/java/com/coffee/bus/registry/constant/DeviceKeyConstant.java

@@ -0,0 +1,32 @@
+package com.coffee.bus.registry.constant;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName DeviceKeyConstant.java
+ * @Description TODO
+ * @createTime 2022年04月09日 13:38:00
+ */
+public class DeviceKeyConstant {
+    public static final String DEVICE_ID="deviceId";
+
+    public static final String ALIAS="alias";
+
+    public static final String ENABLE="enable";
+
+    public static final String TENANT_ID="tenantId";
+
+    public static final String USING_ID="usingId";
+
+    public static final String START_TIME="startTime";
+
+    public static final String PATIENT_CODE="patientCode";
+
+    public static final String STATUS="status";
+
+    public static final String MASTER="master";
+
+    public static final String CLASSIFY="classification";
+
+    public static final String ALARM="alarm";
+}

+ 41 - 0
coffee-system/src/main/java/com/coffee/bus/service/LocalBusDocService.java

@@ -0,0 +1,41 @@
+package com.coffee.bus.service;
+
+import cn.hutool.core.util.StrUtil;
+import com.coffee.bus.entity.BusDeviceEntity;
+import com.coffee.bus.entity.BusDocEntity;
+import com.coffee.bus.mapper.BusDeviceMapper;
+import com.coffee.bus.mapper.BusDocMapper;
+import com.coffee.bus.registry.device.DeviceOperator;
+import com.coffee.bus.registry.device.DeviceRegistry;
+import com.coffee.common.crud.BaseService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName LocalBusHospitalService.java
+ * @Description 设备注册
+ * @createTime 2022年03月19日 09:27:00
+ */
+@Service
+@Slf4j
+public class LocalBusDocService extends BaseService<BusDocMapper, BusDocEntity,String> {
+
+    @Override
+    public void validateBeforeSave(BusDocEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeUpdate(BusDocEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeDelete(String id) {
+
+    }
+}

+ 24 - 20
coffee-system/src/main/java/com/coffee/bus/websocket/listener/DeviceAlarmListener.java

@@ -1,9 +1,12 @@
 package com.coffee.bus.websocket.listener;
 
+import cn.hutool.core.lang.Assert;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.coffee.bus.entity.BusDeviceAlarmEntity;
 import com.coffee.bus.entity.BusDeviceUsingEntity;
 import com.coffee.bus.enums.DeviceStatusEnum;
 import com.coffee.bus.listener.event.bean.DeviceAlarmEvent;
+import com.coffee.bus.service.LocalBusDeviceAlarmService;
 import com.coffee.bus.service.LocalBusDeviceUsingService;
 import com.coffee.common.config.websocket.WebSocketConstant;
 import lombok.AllArgsConstructor;
@@ -11,9 +14,11 @@ import org.springframework.context.event.EventListener;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Arrays;
 import java.util.List;
+import java.util.function.Predicate;
 
 /**
  * @author lifang
@@ -25,31 +30,30 @@ import java.util.List;
 @Component
 @AllArgsConstructor
 public class DeviceAlarmListener {
-    private final LocalBusDeviceUsingService deviceUsingService;
+    private final LocalBusDeviceAlarmService alarmService;
+    private final RedisTemplate redisTemplate;
     /**
      * 监听设备的报警信息,
      * @param alarmEvent
      */
     @EventListener
-    @Async
+    @Transactional(rollbackFor = Exception.class)
     public void deviceAlarm(DeviceAlarmEvent alarmEvent){
-        BusDeviceUsingEntity pump = alarmEvent.getContent();
-        //获取医院配置,对医院功能配置进行过滤筛选
-        DeviceStatusEnum runState = pump.getRunState();
-        //是否解除报警状态
-//        if(runState!=null&&Boolean.TRUE.equals(runState.getAlarm())){
-//            //设备发生报警
-//            //存储报警信息 todo
-//            String topic = WebSocketConstant.getDeviceStateCount(null, runState.name(), pump.getTenantId());
-//            //获取报警设备数量
-//            List<BusDeviceUsingEntity> alarmList = deviceUsingService.list(new QueryWrapper<BusDeviceUsingEntity>()
-//                    .lambda()
-//                    .select(BusDeviceUsingEntity::getId)
-//                    .eq(BusDeviceUsingEntity::getRunState, runState));
-//            //发送告警通知,获取报警设备数量, 下标为0是报警设备总数量,下标为1是设备所属医院的报警设备总数量
-//            List<? extends Number> result = Arrays.asList(alarmList.size(), alarmList.stream().filter(alarm -> alarm.getTenantId().equals(pump.getTenantId())).count());
-//            redisTemplate.convertAndSend(topic, result);
-//        }
-
+        BusDeviceAlarmEntity alarmEntity = alarmEvent.getContent();
+        alarmEntity.tryValidate(entity -> {
+            BusDeviceAlarmEntity alarm= (BusDeviceAlarmEntity) entity;
+            Assert.notBlank(alarm.getDeviceId());
+            Assert.notBlank(alarm.getDeviceHistoryId());
+            Assert.notBlank(alarm.getClassification());
+            Assert.notBlank(alarm.getTenantId());
+            Assert.notNull(alarm.getAlarm());
+            return true;
+        });
+        alarmService.save(alarmEntity);
+        String tenantId = alarmEntity.getTenantId();
+        long count = alarmService.count(new QueryWrapper<BusDeviceAlarmEntity>().lambda().eq(BusDeviceAlarmEntity::getDoing, 1).eq(BusDeviceAlarmEntity::getTenantId,tenantId));
+        //报警信息推送
+        String topic = WebSocketConstant.getDeviceStateCount(null, null, tenantId);
+        redisTemplate.convertAndSend(topic, count);
     }
 }

+ 45 - 2
coffee-system/src/main/java/com/coffee/bus/websocket/listener/DeviceInfoListener.java

@@ -4,9 +4,14 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.coffee.bus.entity.BusDeviceAlarmEntity;
 import com.coffee.bus.entity.BusDeviceUsingEntity;
+import com.coffee.bus.enums.DeviceAlarmEnum;
+import com.coffee.bus.listener.event.bean.DeviceAlarmEvent;
+import com.coffee.bus.registry.constant.DeviceKeyConstant;
 import com.coffee.bus.registry.device.DeviceRegistry;
 import com.coffee.bus.listener.event.bean.DeviceInfoEvent;
 import com.coffee.bus.registry.device.bean.DeviceCacheInfo;
@@ -15,8 +20,10 @@ import com.coffee.bus.registry.patient.PatientOperator;
 import com.coffee.bus.registry.patient.PatientRegistry;
 import com.coffee.bus.registry.patient.bean.DeviceTimeSmallInfo;
 import com.coffee.bus.registry.patient.bean.PatientCacheInfo;
+import com.coffee.bus.service.LocalBusDeviceAlarmService;
 import com.coffee.bus.service.LocalBusDeviceUsingService;
 import com.coffee.bus.service.LocalBusPatientService;
+import com.coffee.common.cache.value.Value;
 import com.coffee.common.config.websocket.WebSocketConstant;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -52,6 +59,7 @@ public class DeviceInfoListener {
 
     private final PatientRegistry patientRegistry;
 
+    private final LocalBusDeviceAlarmService alarmService;
 
     /**
      * 监听上传的数据信息,
@@ -182,6 +190,7 @@ public class DeviceInfoListener {
                     .classification(device.getClassification())
                     .build();
             deviceOperator.set(deviceCacheInfo);
+
             //更新病人缓存信息
             Set<DeviceTimeSmallInfo> allDevice = Optional.ofNullable(patientOperator.getAllDevice()).orElse(new HashSet<>());
             allDevice.add(DeviceTimeSmallInfo.of(deviceId,device.getStartTime()));
@@ -223,12 +232,46 @@ public class DeviceInfoListener {
         Date now = new Date();
         //设置注册时间和泵的开始时间
         pump.setId(String.valueOf(IdWorker.getId()));
-        pump.setRegisterTime(now);
         pump.setStartTime(now);
         pump.setAlias(deviceOperator.getAlias());
     }
 
-//    @Scheduled(cron = "0/15 * * * * ?")
+
+    /**
+     * 判断是否为报警信息并处理
+     * @param historyId 设备存储的历史数据id
+     * @param device 设备信息
+     * @param deviceOperator 设备操作符
+     */
+    private void handleAlarm(String historyId,BusDeviceUsingEntity device,DeviceOperator deviceOperator){
+        Value value = deviceOperator.getValue(DeviceKeyConstant.ALARM);
+        BusDeviceAlarmEntity alarm = new BusDeviceAlarmEntity(device.getDeviceId(),device.getAlarm(),new Date(),0,historyId,device.getClinicId(),device.getClassification());
+        if(Objects.isNull(value.get())){
+            if (device.getAlarm()==null) {
+                //未发生报警且上一信息不为报警信息,将报警信息置为历史信息
+                return;
+            }else {
+                //发生报警且上一信息不为报警信息, todo 处理报警信息
+                SpringUtil.publishEvent(new DeviceAlarmEvent(this,alarm,historyId));
+            }
+        }else {
+            DeviceAlarmEnum beforeAlarm = value.as(DeviceAlarmEnum.class);
+            if (device.getAlarm()==null||device.getAlarm()!=beforeAlarm) {
+                //报警状态改变为过去式,将报警记录置为历史状态
+                alarmService.update(new UpdateWrapper<BusDeviceAlarmEntity>().lambda()
+                        .eq(BusDeviceAlarmEntity::getDeviceId,device.getDeviceId())
+                        .eq(BusDeviceAlarmEntity::getDoing,0)
+                        .set(BusDeviceAlarmEntity::getDoing,1));
+                SpringUtil.publishEvent(new DeviceAlarmEvent(this,alarm,historyId));
+            } else {
+                //重复报警
+                return;
+            }
+        }
+    }
+
+
+    //    @Scheduled(cron = "0/15 * * * * ?")
     public void send() throws InterruptedException {
 //        List<BusDeviceUsingEntity> list = deviceUsingService.list();
 //        list.forEach(pump->{