Browse Source

update 评价模板

18339543638 3 years ago
parent
commit
7551f22370

+ 8 - 11
coffee-admin/src/main/test/java/com/coffee/admin/BusTemplateAnalgesicTest.java

@@ -1,11 +1,8 @@
 package com.coffee.admin;
 
-import com.coffee.bus.controller.BusHospitalController;
-import com.coffee.bus.controller.BusTemplateAnalgesicController;
-import com.coffee.bus.entity.BusHospitalEntity;
-import com.coffee.bus.entity.BusTemplateAnalgesicEntity;
-import com.coffee.bus.service.LocalBusHospitalService;
-import com.coffee.bus.service.LocalBusTemplateAnalgesicService;
+import com.coffee.bus.controller.BusEvaluationTmpController;
+import com.coffee.bus.entity.BusEvaluationTmpEntity;
+import com.coffee.bus.service.LocalBusEvaluationTmpService;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,21 +23,21 @@ import java.util.List;
 @SpringBootTest(classes = AdminApplication.class)
 public class BusTemplateAnalgesicTest {
     @Autowired
-    private LocalBusTemplateAnalgesicService analgesicService;
+    private LocalBusEvaluationTmpService analgesicService;
 
     @Autowired
-    private BusTemplateAnalgesicController analgesicController;
+    private BusEvaluationTmpController analgesicController;
     @Test
     public void save(){
 //        StpUtil.login();
-        BusTemplateAnalgesicEntity analgesicEntity = new BusTemplateAnalgesicEntity();
-        analgesicEntity.setConfig(Arrays.asList("string,test,long"));
+        BusEvaluationTmpEntity analgesicEntity = new BusEvaluationTmpEntity();
+
         analgesicController.add(analgesicEntity);
     }
 
     @Test
     public void query(){
-        List<BusTemplateAnalgesicEntity> list = analgesicService.list();
+        List<BusEvaluationTmpEntity> list = analgesicService.list();
         System.out.println(list);
     }
 

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

@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.Mapper;
 import com.coffee.common.crud.BaseService;
 import com.coffee.common.result.R;
 import io.swagger.v3.oas.annotations.Operation;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.*;
 
 import java.io.Serializable;
 import java.util.*;
@@ -25,9 +22,9 @@ public interface BaseDeleteController<E, K extends Serializable> extends BaseCur
      */
     BaseService<? extends Mapper<E>,E,K> getService();
 
-    @PostMapping("/remove/{id:.+}")
+    @PostMapping("/remove")
     @Operation(summary = "根据ID删除")
-    default R delete(@PathVariable K id) {
+    default R delete(@RequestParam("ids") K id) {
         deleteAuth();
         if(StrUtil.isNullOrUndefined(String.valueOf(id))){
             return R.success();

+ 0 - 30
coffee-common/src/main/java/com/coffee/common/entity/QueryParamEntity.java

@@ -31,34 +31,4 @@ public class QueryParamEntity<T> {
     @Schema(description = "分页查询")
     private Page<T> page;
 
-    /**
-     * @Author lifang
-     * @Date 14:59 2022/3/12
-     * @Description 默认分页
-     * @Param []
-     * @return com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<T>
-     **/
-    public QueryWrapper<T> build(){
-        return build(ObjectUtil.isNotNull(page));
-    }
-
-    public QueryWrapper<T> build(boolean page){
-        QueryWrapper<T> queryWrapper = new QueryWrapper<>();
-        buildIncludes(queryWrapper);
-        buildWhere(queryWrapper);
-        return queryWrapper;
-    }
-
-    private void buildWhere(QueryWrapper<T> queryWrapper){
-        if (CollectionUtil.isNotEmpty(wheres)) {
-            wheres.forEach(term -> term.getType().build(queryWrapper,term));
-        }
-    }
-
-    private void buildIncludes(QueryWrapper<T> queryWrapper){
-        if(CollectionUtil.isNotEmpty(includes)){
-            queryWrapper.select(includes.toArray(new String[includes.size()+1]));
-        }
-    }
-
 }

+ 3 - 2
coffee-common/src/main/java/com/coffee/common/entity/param/Term.java

@@ -1,5 +1,6 @@
 package com.coffee.common.entity.param;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.EqualsAndHashCode;
@@ -51,14 +52,14 @@ public class Term implements Cloneable, Serializable {
         or{
             @Override
             public void build(QueryWrapper<?> queryWrapper, Term term) {
-                term.getTermType().build(queryWrapper.or(),term.getColumn(),term.getValue());
+                term.getTermType().build(queryWrapper.or(), StrUtil.toUnderlineCase(term.getColumn()),term.getValue());
             }
         }
         ,
         and{
             @Override
             public void build(QueryWrapper<?> queryWrapper,Term term){
-                term.getTermType().build(queryWrapper,term.getColumn(),term.getValue());
+                term.getTermType().build(queryWrapper,StrUtil.toUnderlineCase(term.getColumn()),term.getValue());
             };
         };
 

+ 8 - 10
coffee-system/src/main/java/com/coffee/bus/controller/BusAnalgesicScoreController.java → coffee-system/src/main/java/com/coffee/bus/controller/BusEvaluationController.java

@@ -1,10 +1,8 @@
 package com.coffee.bus.controller;
 
 import com.baomidou.mybatisplus.core.mapper.Mapper;
-import com.coffee.bus.entity.BusAnalgesicScoreEntity;
-import com.coffee.bus.entity.BusTemplateAnalgesicEntity;
-import com.coffee.bus.service.LocalBusAnalgesicScoreService;
-import com.coffee.bus.service.LocalBusTemplateAnalgesicService;
+import com.coffee.bus.entity.BusEvaluationEntity;
+import com.coffee.bus.service.LocalBusEvaluationService;
 import com.coffee.common.crud.BaseService;
 import com.coffee.common.crud.controller.BaseCrudController;
 import io.swagger.annotations.Api;
@@ -21,10 +19,10 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @AllArgsConstructor
-@RequestMapping("/analgesic/score")
-@Api(tags = "评价管理",description = "统一权限前缀(analgesic:score),analgesic:score:add")
-public class BusAnalgesicScoreController extends BaseCrudController<BusAnalgesicScoreEntity, String> {
-    private final LocalBusAnalgesicScoreService scoreService;
+@RequestMapping("/bus/eval")
+@Api(tags = "评价管理",description = "统一权限前缀(bus:eval),bus:eval:add")
+public class BusEvaluationController extends BaseCrudController<BusEvaluationEntity, String> {
+    private final LocalBusEvaluationService scoreService;
 
 
     /**
@@ -33,11 +31,11 @@ public class BusAnalgesicScoreController extends BaseCrudController<BusAnalgesic
      */
     @Override
     public String getPermissionPrefix() {
-        return "analgesic:score";
+        return "bus:eval";
     }
 
     @Override
-    public BaseService<? extends Mapper<BusAnalgesicScoreEntity>, BusAnalgesicScoreEntity, String> getService() {
+    public BaseService<? extends Mapper<BusEvaluationEntity>, BusEvaluationEntity, String> getService() {
         return scoreService;
     }
 }

+ 9 - 11
coffee-system/src/main/java/com/coffee/bus/controller/BusTemplateAnalgesicController.java → coffee-system/src/main/java/com/coffee/bus/controller/BusEvaluationTmpController.java

@@ -1,10 +1,8 @@
 package com.coffee.bus.controller;
 
 import com.baomidou.mybatisplus.core.mapper.Mapper;
-import com.coffee.bus.entity.BusHospitalLogEntity;
-import com.coffee.bus.entity.BusTemplateAnalgesicEntity;
-import com.coffee.bus.service.LocalBusHospitalLogService;
-import com.coffee.bus.service.LocalBusTemplateAnalgesicService;
+import com.coffee.bus.entity.BusEvaluationTmpEntity;
+import com.coffee.bus.service.LocalBusEvaluationTmpService;
 import com.coffee.common.crud.BaseService;
 import com.coffee.common.crud.controller.BaseCrudController;
 import io.swagger.annotations.Api;
@@ -21,10 +19,10 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @AllArgsConstructor
-@RequestMapping("/temp/analgesic")
-@Api(tags = "评价模板管理",description = "统一权限前缀(temp:analgesic),temp:analgesic:add")
-public class BusTemplateAnalgesicController extends BaseCrudController<BusTemplateAnalgesicEntity, String> {
-    private final LocalBusTemplateAnalgesicService analgesicService;
+@RequestMapping("/eval/tmp")
+@Api(tags = "评价模板管理",description = "统一权限前缀(eval:tmp),eval:tmp:add")
+public class BusEvaluationTmpController extends BaseCrudController<BusEvaluationTmpEntity, String> {
+    private final LocalBusEvaluationTmpService evalTmpService;
 
 
     /**
@@ -33,11 +31,11 @@ public class BusTemplateAnalgesicController extends BaseCrudController<BusTempla
      */
     @Override
     public String getPermissionPrefix() {
-        return "temp:analgesic";
+        return "eval:tmp";
     }
 
     @Override
-    public BaseService<? extends Mapper<BusTemplateAnalgesicEntity>, BusTemplateAnalgesicEntity, String> getService() {
-        return analgesicService;
+    public BaseService<? extends Mapper<BusEvaluationTmpEntity>, BusEvaluationTmpEntity, String> getService() {
+        return evalTmpService;
     }
 }

+ 2 - 2
coffee-system/src/main/java/com/coffee/bus/entity/BusAnalgesicScoreEntity.java → coffee-system/src/main/java/com/coffee/bus/entity/BusEvaluationEntity.java

@@ -35,9 +35,9 @@ import javax.validation.constraints.Size;
 @Data
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@TableName("bus_analgesic_score")
+@TableName("bus_evaluation")
 @ApiModel(value="评价得分", description="评价得分实体类")
-public class BusAnalgesicScoreEntity extends TenantGenericEntity<String,String> {
+public class BusEvaluationEntity extends TenantGenericEntity<String,String> {
 
     @ApiModelProperty(value = "病号")
     @Length(max = 255,message = "病号长度不得超过255个字节")

+ 6 - 14
coffee-system/src/main/java/com/coffee/bus/entity/BusTemplateAnalgesicEntity.java → coffee-system/src/main/java/com/coffee/bus/entity/BusEvaluationTmpEntity.java

@@ -2,45 +2,40 @@ package com.coffee.bus.entity;
 
 import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
 import com.coffee.common.config.mybatis.DateToBigIntHandler;
-import com.coffee.common.entity.RecordCreationEntity;
-import com.coffee.common.entity.RecordModifierEntity;
 import com.coffee.common.entity.TenantGenericEntity;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.hibernate.validator.constraints.Length;
 
 import java.util.*;
 
 /**
  * @author lifang
  * @version 1.0.0
- * @ClassName BusTemplateAnalgesicEntity.java
+ * @ClassName BusEvaluationTmpEntity.java
  * @Description TODO
  * @createTime 2022年03月21日 14:18:00
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
-@TableName(value = "bus_template_analgesic",autoResultMap = true)
+@TableName(value = "bus_evaluation_temp",autoResultMap = true)
 @ApiModel(value="评价模板", description="评价模板")
-public class BusTemplateAnalgesicEntity  extends TenantGenericEntity<Long,Long> implements RecordModifierEntity, RecordCreationEntity {
+public class BusEvaluationTmpEntity extends TenantGenericEntity<String,String> {
 
-    @ApiModelProperty(value = "评价配置详情(接收数据为String集合,请传入需要展示的字段集合,如[\"createBy\",\"createTime\"])")
-    @Length(max = 1024,message = "评价配置详情长度不得超过1024个字节")
+    @ApiModelProperty(value = "不需要评价的字段,如calm、leftArm等")
     @TableField(typeHandler = FastjsonTypeHandler.class)
-    private List<String> config;
+    private List<String> excludeConfig;
 
 
     @TableField(fill = FieldFill.INSERT)
     private String createBy;
 
-    @TableField(fill = FieldFill.UPDATE)
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     private String updateBy;
 
     @TableField(typeHandler = DateToBigIntHandler.class,fill = FieldFill.INSERT)
@@ -51,7 +46,4 @@ public class BusTemplateAnalgesicEntity  extends TenantGenericEntity<Long,Long>
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
-    @TableField(fill = FieldFill.INSERT)
-    @TableLogic(value = "0",delval = "1")
-    private Integer isDelete;
 }

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

@@ -78,7 +78,7 @@ public class BusHospitalEntity extends GenericEntity<String> implements RecordMo
     @TableField(fill = FieldFill.INSERT)
     private String createBy;
 
-    @TableField(fill = FieldFill.UPDATE)
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     private String updateBy;
 
     @TableField(typeHandler = DateToBigIntHandler.class,fill = FieldFill.INSERT)

+ 18 - 0
coffee-system/src/main/java/com/coffee/bus/enums/EvalEnum.java

@@ -0,0 +1,18 @@
+package com.coffee.bus.enums;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName EvalType.java
+ * @Description 评价类型
+ * @createTime 2022年03月22日 11:22:00
+ */
+public enum EvalEnum {
+    String,
+    Integer,
+    Enum,
+    Boolean;
+
+    Class<?> aClass;
+
+}

+ 0 - 4
coffee-system/src/main/java/com/coffee/bus/listener/event/bean/DeviceInfoEvent.java

@@ -41,8 +41,4 @@ public class DeviceInfoEvent extends ApplicationEvent {
         this.deviceId=deviceId;
     }
 
-
-//    public static void main(String[] args) {
-//        SpringUtil.publishEvent(new DeviceInfoEvent(this,ReportType.LINE,new JSONObject(),"123556"));
-//    }
 }

+ 2 - 2
coffee-system/src/main/java/com/coffee/bus/mapper/BusTemplateAnalgesicMapper.java → coffee-system/src/main/java/com/coffee/bus/mapper/BusEvaluationMapper.java

@@ -1,7 +1,7 @@
 package com.coffee.bus.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.coffee.bus.entity.BusTemplateAnalgesicEntity;
+import com.coffee.bus.entity.BusEvaluationEntity;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -12,5 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
  * @createTime 2022年03月19日 09:15:00
  */
 @Mapper
-public interface BusTemplateAnalgesicMapper extends BaseMapper<BusTemplateAnalgesicEntity> {
+public interface BusEvaluationMapper extends BaseMapper<BusEvaluationEntity> {
 }

+ 2 - 3
coffee-system/src/main/java/com/coffee/bus/mapper/BusAnalgesicScoreMapper.java → coffee-system/src/main/java/com/coffee/bus/mapper/BusEvalutaionTmpMapper.java

@@ -1,8 +1,7 @@
 package com.coffee.bus.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.coffee.bus.entity.BusAnalgesicScoreEntity;
-import com.coffee.bus.entity.BusTemplateAnalgesicEntity;
+import com.coffee.bus.entity.BusEvaluationTmpEntity;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -13,5 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
  * @createTime 2022年03月19日 09:15:00
  */
 @Mapper
-public interface BusAnalgesicScoreMapper extends BaseMapper<BusAnalgesicScoreEntity> {
+public interface BusEvalutaionTmpMapper extends BaseMapper<BusEvaluationTmpEntity> {
 }

+ 5 - 5
coffee-system/src/main/java/com/coffee/bus/service/LocalBusAnalgesicScoreService.java → coffee-system/src/main/java/com/coffee/bus/service/LocalBusEvaluationService.java

@@ -1,7 +1,7 @@
 package com.coffee.bus.service;
 
-import com.coffee.bus.entity.BusAnalgesicScoreEntity;
-import com.coffee.bus.mapper.BusAnalgesicScoreMapper;
+import com.coffee.bus.entity.BusEvaluationEntity;
+import com.coffee.bus.mapper.BusEvaluationMapper;
 import com.coffee.common.crud.BaseService;
 import org.springframework.stereotype.Service;
 
@@ -13,14 +13,14 @@ import org.springframework.stereotype.Service;
  * @createTime 2022年03月19日 09:27:00
  */
 @Service
-public class LocalBusAnalgesicScoreService extends BaseService<BusAnalgesicScoreMapper, BusAnalgesicScoreEntity,String> {
+public class LocalBusEvaluationService extends BaseService<BusEvaluationMapper, BusEvaluationEntity,String> {
     @Override
-    public void validateBeforeSave(BusAnalgesicScoreEntity entity) {
+    public void validateBeforeSave(BusEvaluationEntity entity) {
 
     }
 
     @Override
-    public void validateBeforeUpdate(BusAnalgesicScoreEntity entity) {
+    public void validateBeforeUpdate(BusEvaluationEntity entity) {
 
     }
 

+ 5 - 5
coffee-system/src/main/java/com/coffee/bus/service/LocalBusTemplateAnalgesicService.java → coffee-system/src/main/java/com/coffee/bus/service/LocalBusEvaluationTmpService.java

@@ -1,7 +1,7 @@
 package com.coffee.bus.service;
 
-import com.coffee.bus.entity.BusTemplateAnalgesicEntity;
-import com.coffee.bus.mapper.BusTemplateAnalgesicMapper;
+import com.coffee.bus.entity.BusEvaluationTmpEntity;
+import com.coffee.bus.mapper.BusEvalutaionTmpMapper;
 import com.coffee.common.crud.BaseService;
 import org.springframework.stereotype.Service;
 
@@ -13,14 +13,14 @@ import org.springframework.stereotype.Service;
  * @createTime 2022年03月19日 09:27:00
  */
 @Service
-public class LocalBusTemplateAnalgesicService extends BaseService<BusTemplateAnalgesicMapper, BusTemplateAnalgesicEntity,String> {
+public class LocalBusEvaluationTmpService extends BaseService<BusEvalutaionTmpMapper, BusEvaluationTmpEntity,String> {
     @Override
-    public void validateBeforeSave(BusTemplateAnalgesicEntity entity) {
+    public void validateBeforeSave(BusEvaluationTmpEntity entity) {
 
     }
 
     @Override
-    public void validateBeforeUpdate(BusTemplateAnalgesicEntity entity) {
+    public void validateBeforeUpdate(BusEvaluationTmpEntity entity) {
 
     }