Parcourir la source

fix 输注监控sql修复
fix user类id传输转为string类型
del 删除冗余过滤器
update 将sa权限过滤器,改为handlerInterceptor处理拦截器

18339543638 il y a 3 ans
Parent
commit
0d2b26b3bf

+ 0 - 48
coffee-common/src/main/java/com/coffee/common/config/mybatis/WebConfig.java

@@ -1,48 +0,0 @@
-package com.coffee.common.config.mybatis;
-
-import java.math.BigInteger;
-import java.nio.charset.Charset;
-import java.util.List;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.StringHttpMessageConverter;
-import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-@Configuration
-@EnableWebMvc
-public class WebConfig implements WebMvcConfigurer {
-
-    @Override
-    public void addResourceHandlers(ResourceHandlerRegistry registry) {
-        registry.addResourceHandler("/statics/**").addResourceLocations("classpath:/statics/");
-    }
-    
-    /**
-     * * 针对Long丢失经度问题;发现后台返回前台的数据不会出现问题。前台请求的数据也是正常的
-     * * 只不过前台js获取到页面上会出现问题,针对以上情况,在前台js中,修改id的name值为id_
-     */
-    @Override
-    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
-        MappingJackson2HttpMessageConverter jackson2HttpMessageConverter =
-                new MappingJackson2HttpMessageConverter();
-        
-        ObjectMapper objectMapper = new ObjectMapper();
-        SimpleModule simpleModule = new SimpleModule();
-        simpleModule.addSerializer(BigInteger.class, ToStringSerializer.instance);
-        simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
-        simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
-        objectMapper.registerModule(simpleModule);
-        jackson2HttpMessageConverter.setObjectMapper(objectMapper);
-        converters.add(jackson2HttpMessageConverter);
-        converters.add(new StringHttpMessageConverter(Charset.forName("UTF-8")));
-    }
-    
-
-}

+ 6 - 0
coffee-common/src/main/java/com/coffee/common/entity/GenericEntity.java

@@ -4,10 +4,15 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.validation.annotation.Validated;
 
 
+import javax.validation.constraints.NotNull;
 import java.util.Date;
 
 @Data
@@ -16,6 +21,7 @@ public abstract class  GenericEntity<PK> implements Entity,RecordModifierEntity,
 
     @TableId(type = IdType.ASSIGN_ID)
     @ApiModelProperty(value = "id")
+    @JsonSerialize(using = ToStringSerializer.class)
     private PK id;
 
     @TableField(fill = FieldFill.INSERT)

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

@@ -25,6 +25,7 @@ public abstract class TenantGenericEntity<PK,TN> extends GenericEntity<PK> {
     @Getter
     @TableField(value = "tenant_id",fill = FieldFill.INSERT)
     @Setter
+    @JsonSerialize(using = ToStringSerializer.class)
     private TN tenantId;
 
     @Getter

+ 1 - 0
coffee-common/src/main/java/com/coffee/common/entity/param/Term.java

@@ -53,6 +53,7 @@ public class Term implements Cloneable, Serializable {
             @Override
             public void build(QueryWrapper<?> queryWrapper,Term term){
                 term.getTermType().build(queryWrapper,StrUtil.toUnderlineCase(term.getColumn()),term.getValue());
+                term.getTermType().buildCollection(queryWrapper,StrUtil.toUnderlineCase(term.getColumn()),term.getValues());
             };
         };
 

+ 14 - 13
coffee-framework/src/main/java/com/coffee/framework/config/SaTokenConfig.java

@@ -6,10 +6,14 @@ import cn.dev33.satoken.router.SaRouter;
 import cn.dev33.satoken.stp.StpUtil;
 import com.google.common.collect.Lists;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.HandlerInterceptor;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
@@ -19,8 +23,17 @@ import java.util.List;
  */
 @Slf4j
 @Configuration
-public class SaTokenConfig implements WebMvcConfigurer {
+public class SaTokenConfig {
 
+    @Bean
+    public HandlerInterceptor handlerInterceptor(){
+        return new SaRouteInterceptor((req, res, handler) -> {
+            log.info("访问路径:{}", req.getRequestPath());
+            SaRouter.match("/**")
+                    .notMatch(IGNORE_URL)
+                    .check(StpUtil::checkLogin);
+        });
+    }
     private static final List<String> IGNORE_URL = Lists.newArrayList();
 
     static {
@@ -41,16 +54,4 @@ public class SaTokenConfig implements WebMvcConfigurer {
         IGNORE_URL.add("/system/sysDept/**");
     }
 
-    @Override
-    public void addInterceptors(InterceptorRegistry registry) {
-         // 注册路由拦截器,自定义认证规则
-        registry.addInterceptor(new SaRouteInterceptor((req, res, handler) -> {
-            log.info("访问路径:{}", req.getRequestPath());
-            SaRouter.match("/**")
-                    .notMatch(IGNORE_URL)
-                    .check(StpUtil::checkLogin);
-        }));
-        registry.addInterceptor(new SaAnnotationInterceptor()).addPathPatterns("/**");
-    }
-
 }

+ 0 - 6
coffee-framework/src/main/java/com/coffee/framework/config/WebAppMvcConfig.java

@@ -34,12 +34,6 @@ public class WebAppMvcConfig implements WebMvcConfigurer {
     public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
         MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
         ObjectMapper objectMapper = converter.getObjectMapper();
-        // 生成JSON时,将所有Long转换成String
-//        SimpleModule dateSimpleModule = new SimpleModule();
-//        dateSimpleModule.addSerializer(Long.class, ToStringSerializer.instance);
-//        dateSimpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
-//
-//        objectMapper.registerModule(dateSimpleModule);
         // 时间格式化
         objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
         objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));

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

@@ -2,7 +2,9 @@ package com.coffee.bus.controller;
 
 import cn.dev33.satoken.SaManager;
 import cn.dev33.satoken.stp.StpLogic;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.mapper.Mapper;
+import com.coffee.bus.controller.vo.DeviceManualVo;
 import com.coffee.bus.entity.BusDeviceManualEntity;
 import com.coffee.bus.entity.BusDrugEntity;
 import com.coffee.bus.service.LocalBusDeviceManualService;
@@ -10,8 +12,12 @@ import com.coffee.bus.service.LocalBusDrugService;
 import com.coffee.common.crud.BaseService;
 import com.coffee.common.crud.controller.BaseCrudController;
 import com.coffee.common.crud.controller.BaseQueryController;
+import com.coffee.common.result.R;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -25,7 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @AllArgsConstructor
 @RequestMapping("/device/manual")
-@Api(tags = "无泵管理(即手动添加设备管理)",description = "统一权限前缀(device:manual),device:manual:add")
+@Api(tags = "其他监控(即手动添加设备管理)",description = "统一权限前缀(device:manual),device:manual:add")
 public class BusDeviceManualController implements BaseQueryController<BusDeviceManualEntity,String> {
     private final LocalBusDeviceManualService deviceManualService;
 
@@ -50,4 +56,17 @@ public class BusDeviceManualController implements BaseQueryController<BusDeviceM
         return deviceManualService;
     }
 
+    @PostMapping("/edit")
+    @ApiOperation(value = "编辑病人信息",notes = "编辑病人信息,权限【device:manual:edit】")
+    public R edit(@RequestBody DeviceManualVo entity){
+//        deviceManualService.update(entity.getManual(),entity.getClinic());
+        return R.success();
+    }
+
+    @PostMapping("/save")
+    @ApiOperation(value = "新增病人信息",notes = "新增病人信息,权限【device:manual:save】")
+    public R save(@RequestBody DeviceManualVo entity){
+//        deviceManualService.save(entity.getManual(),entity.getClinic());
+        return R.success();
+    }
 }

+ 23 - 0
coffee-system/src/main/java/com/coffee/bus/controller/vo/DeviceManualVo.java

@@ -0,0 +1,23 @@
+package com.coffee.bus.controller.vo;
+
+import com.coffee.bus.entity.BusClinicEntity;
+import com.coffee.bus.entity.BusDeviceManualEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName DeviceManualVo.java
+ * @Description TODO
+ * @createTime 2022年05月06日 09:29:00
+ */
+@ApiModel("手动添加其他监控视图")
+@Data
+public class DeviceManualVo {
+    @ApiModelProperty("设备信息")
+    private BusDeviceManualEntity manual;
+    @ApiModelProperty("手术信息")
+    private BusClinicEntity clinic;
+}

+ 9 - 4
coffee-system/src/main/java/com/coffee/bus/entity/PatientMonitorDomain.java

@@ -1,9 +1,8 @@
 package com.coffee.bus.entity;
 
-import com.coffee.bus.enums.DeviceAlarmEnum;
-import com.coffee.bus.enums.DeviceTypeEnum;
-import com.coffee.bus.enums.DeviceStatusEnum;
-import com.coffee.bus.enums.PatientAlarmEnum;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.coffee.bus.enums.*;
 import com.coffee.common.enums.SexEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -54,6 +53,12 @@ public class PatientMonitorDomain {
     @ApiModelProperty(value = "公共参数-首次量")
     private Integer firstDose;
 
+    @ApiModelProperty(value = "加减档提示",readOnly = true)
+    @TableField(updateStrategy = FieldStrategy.DEFAULT)
+    private FlowStatusEnum warnFlow;
+
+    @ApiModelProperty(value = "公共参数-电量",readOnly = true)
+    private Integer electricQuantity;
 
     @ApiModelProperty(value = "公共参数-剩余量")
     private BigDecimal remainDose;

+ 0 - 2
coffee-system/src/main/java/com/coffee/bus/service/LocalBusPatientService.java

@@ -165,7 +165,5 @@ public class LocalBusPatientService extends BaseService<BusPatientMapper, BusPat
         patientOperator.setName(patient.getName());
         patientOperator.setBedNo(clinic.getBedNo());
         patientOperator.setWard(clinic.getWard());
-
-
     }
 }

+ 12 - 3
coffee-system/src/main/java/com/coffee/bus/service/dto/PatientMonitorQuery.java

@@ -23,14 +23,23 @@ public class PatientMonitorQuery {
     @ApiModelProperty("病区查询集合")
     private List<String> wards;
 
+    /**
+     * @see  DeviceTypeEnum #value
+     */
     @ApiModelProperty("设备类型查询,网络泵、脉冲泵、智能泵")
-    private List<DeviceTypeEnum> types;
+    private List<Integer> types;
 
+    /**
+     * @see  DeviceStatusEnum #value
+     */
     @ApiModelProperty("设备输注最后运行状态查询")
-    private List<DeviceStatusEnum> deviceStatus;
+    private List<Integer> deviceStatus;
 
+    /**
+     * @see  DeviceAlarmEnum #value
+     */
     @ApiModelProperty("设备输注最后报警状态")
-    private List<DeviceAlarmEnum> deviceAlarms;
+    private List<Integer> deviceAlarms;
 
     @ApiModelProperty("设备输注最后即将结束警告")
     private boolean warnWillFinished;

+ 1 - 0
coffee-system/src/main/java/com/coffee/system/entity/SysUser.java

@@ -17,6 +17,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.models.auth.In;
 import lombok.Data;
+import org.python.antlr.ast.Str;
 
 import java.io.Serializable;
 import java.util.Date;

+ 6 - 1
coffee-system/src/main/resources/mapper/bus/BusPatientMapper.xml

@@ -51,6 +51,8 @@
         <result column="flow_down_limit" property="flowDownLimit"/>
         <result column="flow_adjust_rate" property="flowAdjustRate"/>
         <result column="run_state" property="deviceRunState"/>
+        <result column="electric_quantity" property="electricQuantity"/>
+        <result column="warn_flow" property="warnFlow"/>
         <result column="warn_analgesic_poor" property="warnAnalgesicPoor"/>
         <result column="warn_low_battery" property="warnLowBattery"/>
         <result column="warn_will_finished" property="warnWillFinished"/>
@@ -150,6 +152,8 @@
         i.append_dose as append_dose,
         i.append_lock_time as append_lock_time,
         i.max_dose as max_dose,
+        i.electric_quantity as electric_quantity,
+        i.warn_flow as warn_flow,
         i.self_control_count as self_control_count,
         i.self_control_lock_time as self_control_lock_time,
         i.pca_valid_count as pca_valid_count,
@@ -182,8 +186,9 @@
         (select * from bus_patient)
         as p
         join
-        (select * from bus_infusion_history  where is_undo='0'
+        (select * from bus_infusion_history
         <where>
+            is_undo='0'
             <if test="query.wards != null and query.wards.size > 0">
                 and ward in
                 <foreach item="ward" index="index" collection="query.wards" open="(" separator="," close=")">